import axios from './http'
import qs from 'qs'
import {
  $api,
  $pay,
  $api2
} from './config.js'

//获取token
export const getToken = data => axios.post($api + '/oauth2/token', qs.stringify(data));
//登录
export const zylogin = data => axios.post($api + '/api/JYEAccount/LoginInter', qs.stringify(data));
//获取用户信息
export const getUserInfo = data => axios.post($api + '/api/JYEweb/GetELFunUserInfo', qs.stringify(data));
// 章鱼币总和信息
export const GetZyHy = data => axios.post($api + '/api/JYEweb/GetZyHyIndexModel', qs.stringify(data));
// 邀请列表（根据日期缓存分页）
export const GetYaoQing = data => axios.post($api + '/api/JYEweb/GetEDLYaoQingList', qs.stringify(data));
//获取钱包主页BTC等等列表；并且包含兑换列表
export const GetQbCreatePs = data => axios.post($api + '/api/JYEweb/GetQbCreatePsListModel', qs.stringify(data));
// 获取公告接口
export const GetGGMessage = data => axios.post($api + '/api/JYEweb/GetGGMessage', qs.stringify(data));
// 获取币详细页信息
export const GetLock = data => axios.post($api + '/api/JYEweb/GetLockMoney', qs.stringify(data));
// BTC兑换章鱼币
export const GetDhPs = data => axios.post($api + '/api/JYEweb/GetDhPsFun', qs.stringify(data));
//提现比特币
export const GetTxBTB = data => axios.post($api + '/api/JYEweb/GetTxBTBList', qs.stringify(data));
// 根据地址提现章鱼丸
export const GetDhZyWByUser = data => axios.post($api + '/api/JYEweb/GetDhZyWByUser', qs.stringify(data));
// 根据GameID转账
export const GetZsSendByPSFun = data => axios.post($api + '/api/JYEweb/GetZsSendByPSFun', qs.stringify(data));

// 支付宝接口
export const webpay = data => axios.post($pay + '/mobilePage/webpay.aspx', qs.stringify(data));

// 获取支付配置信息
export const encryptWx = () => axios.get($pay + '/mobilePage/EncryptWx.aspx', {});
// /mobilePage/WxPay.aspx



//********************************************以上第一版******************************************************************** */

//上传头像
export const uplaodTouXiang = data => axios.post($api + '/api/JYEweb/GetUplaodTouXiang', qs.stringify(data));
//奖励明细
export const getJLDetail = data => axios.post($api + '/api/JYEweb/GetJLDetail', qs.stringify(data));
// 获取转账记录
export const getZsSendByPS = data => axios.post($api + '/api/JYEweb/GetZsSendByPSList', qs.stringify(data));
//每日行情
export const gethqPriceList = data => axios.post($api + '/api/JYEweb/GethqPriceList', qs.stringify(data));
// 章鱼丸兑换话费接口
export const telephoneFees = data => axios.post($api + '/api/JYEweb/LBoperateGetJYEhfPay', qs.stringify(data));
// 章鱼丸兑换话费比例配置列表
export const getTelephoneFeesList = data => axios.post($api + '/api/JYEweb/LBoperateGetHFLB', qs.stringify(data));
// 获得签到挖矿列表数据
export const getSinging = data => axios.post($api + '/api/JYEweb/GetSingingList', qs.stringify(data));
// 签到功能
export const singingdeWK = data => axios.post($api + '/api/JYEweb/SingingdeWK', qs.stringify(data));
// 获取游戏列表
export const JYEGameList = data => axios.post($api + '/api/JYEAccount/JYEGameListByDL', qs.stringify(data));
//性别
export const changeUserGx = data => axios.post($api + '/api/JYEweb/LBoperateUserGx', qs.stringify(data));
// 忘记密码（此接口的token的获取和登录是一样的）
export const changePsw = data => axios.post($api + '/api/JYEAccount/GxMMFun', qs.stringify(data));
// 账单接口
export const checkList = data => axios.post($api + '/api/JYEweb/GetFeelCheckList', qs.stringify(data));
// 背包人参展示接口
export const bagList = data => axios.post($api + '/api/JYEweb/GetJYEBagList', qs.stringify(data));
// 人参礼包录入地址接口
export const addJYEBagAddress = data => axios.post($api + '/api/JYEweb/AddJYEBagAddress', qs.stringify(data));

// 认购福利展示列表
export const FundWelList = data => axios.post($api + '/api/JYEweb/GetJYEFundWelList', qs.stringify(data));
// 认购接口
export const PayFundWel = data => axios.post($api + '/api/JYEweb/PayFundWel', qs.stringify(data));

// 密保卡支付接口
export const payPassCard = data => axios.post($api + '/api/JYEweb/PayPassCard', qs.stringify(data));

// 校验机器码跟上次设备是否一致
export const sendPassCardInfo = data => axios.post($api + '/api/JYEweb/CheckUserMachineInfo', qs.stringify(data));

// 密保卡发送验证码接口
export const sendPassCardInfo1 = data => axios.post($api + '/api/JYEweb/SendPassCardInfo', qs.stringify(data));

// 设置支付密码接口
export const userBankPassInfo = data => axios.post($api + '/api/JYEweb/CheckUserBankPassInfo', qs.stringify(data));



// ================礼包码相关===================================================================

// 绑定好友
export const bindUserByNoPay = data => axios.post($api + '/api/JYEweb/BindUserByNoPay', qs.stringify(data));

// 赠送礼包码
export const sendLivcardAssociator = data => axios.post($api + '/api/JYEweb/SendLivcardAssociator', qs.stringify(data));

// 用户礼包码列表页
export const getGiftBagList = data => axios.post($api + '/api/JYEweb/GetJYELivcardAssociatorList', qs.stringify(data));

// 使用礼包码激活用户
export const userByPayHY = data => axios.post($api + '/api/JYEweb/UserByPayHY', qs.stringify(data));


//============= 2019 聊天相关====================================
// 聊天登录
export const chatLoginApi = data => axios.post('http://47.99.182.196:9999/v1/user/login', qs.stringify(data));



// 获取聊天室列表
export const chatroomList = data => axios.post($api + '/chatroom/lists', qs.stringify(data));

// 用户登录
//export const login2 = data => axios.post($api2 + '/api/user/login', qs.stringify(data));

// export const getJYEVersion = axios.get($api + '/JYEPay/GetJYEVersion', qs.stringify({}))


//#################### 2.0 接口
//登录
export const zylogin2 = data => axios.post($api2 + '/api/user/login', qs.stringify(data));

//**************************** 直播相关 *************************
export const getLiveInfo = data => axios.post($api2 + '/api/room/get', qs.stringify(data));
export const createLive = data => axios.post($api2 + '/api/room/create', qs.stringify(data));
export const updateLiveName = data => axios.post($api2 + '/api/room/updateRoomName', qs.stringify(data));
export const updateLiveAvatar = data => axios.post($api2 + '/api/room/updateAvatar', qs.stringify(data));
export const getLiveLists = data => axios.post($api2 + '/api/room/lists', qs.stringify(data));

// 礼物相关
export const getGiftReceiveLists = data => axios.post($api2 + '/api/gift/receivelist', qs.stringify(data));
export const getGiftLists = data => axios.post($api2 + '/api/gift/lists', qs.stringify(data));
export const giveGiftPay = data => axios.post($api2 + '/api/gift/pay', qs.stringify(data));

// 聊天室
export const getChatroomLists = data => axios.post($api2 + '/api/chatroom/lists', qs.stringify(data));

//红包创建
export const sendredPacket = data => axios.post($api2 + '/api/luckymoney/create', qs.stringify(data));
//红包领取
export const grabRedPacket = data => axios.post($api2 + '/api/luckymoney/grab', qs.stringify(data));
